#!/bin/sh
#列出本机所有网络服务
networksetup -listallnetworkservices
if [ $1 == '1' ]; then
echo "设置Wi-Fi自动获取ip"
networksetup -setdhcp "Wi-Fi"
else
echo "设置Wi-Fi静态ip $1"
networksetup -setmanual "Wi-Fi" $1 255.255.255.0 10.0.0.1
fi